<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="UTF-8">
    <title>发货单列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="icon" th:href="@{/static/console/common/images/favicon.ico}">
    <link rel="stylesheet" type="text/css" th:href="@{/static/css/element/index.css}"/>
    <link rel="stylesheet" type="text/css"
          th:href="@{/static/console/css/production/invoice.css?version=202503261742}"/>
</head>
<body>
<div id="container">
    <el-container>
        <el-header v-if="initIndentId == null" height="50">
            <el-date-picker v-model="tableSearch.startTime"
                            type="datetime"
                            :value-format="tableSearch.dateFormat"
                            placeholder="起始日期" size="mini">
            </el-date-picker>
            <el-date-picker v-model="tableSearch.endTime"
                            type="datetime"
                            :value-format="tableSearch.dateFormat"
                            placeholder="截止日期" size="mini">
            </el-date-picker>
            <el-input v-model="tableSearch.searchVal" placeholder="搜索信息" clearable size="mini"></el-input>
            <el-button type="success" icon="el-icon-search" @click="searchDatas" size="mini">查询</el-button>
        </el-header>
        <el-main>
            <template>
                <el-table :data="tableDatas" border v-loading="tableLoading" max-height="750" highlight-current-row
                          size="mini">
                    <el-table-column label="序号"
                                     show-overflow-tooltip
                                     type="index"
                                     width="50"></el-table-column>
                    <el-table-column prop="code" show-overflow-tooltip
                                     label="发货单编号"
                                     width="180"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="conName"
                                     label="工程名称"
                                     width="240"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="site"
                                     label="施工部位"
                                     width="240"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="strengthName"
                                     label="砼强度"
                                     width="150">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="tech"
                                     label="特性要求"
                                     width="150">
                    </el-table-column>
                    <el-table-column label="发货类型"
                                     width="120">
                        <template slot-scope="scope">
                            <template v-if="scope.row.invoiceType == 0">
                                <el-tag>{{scope.row.invoiceTypeTxt}}</el-tag>
                            </template>
                            <template v-else-if="scope.row.invoiceType == 1">
                                <el-tag type="warning">{{scope.row.invoiceTypeTxt}}</el-tag>
                            </template>
                            <template v-else="scope.row.invoiceType == 2">
                                <el-tag type="info">{{scope.row.invoiceTypeTxt}}</el-tag>
                            </template>
                        </template>
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="sendStere"
                                     label="发货方量(方)"
                                     width="120">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     label="累计车次"
                                     width="120">
                        <template slot-scope="scope">
                            <template v-if="scope.row.process != 6">
                                {{scope.row.totalCar}}
                            </template>
                        </template>
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     label="累计方量"
                                     width="120">
                        <template slot-scope="scope">
                            <template v-if="scope.row.process != 6">
                                {{scope.row.totalStere}}
                            </template>
                        </template>
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="proTime"
                                     label="生产时间"
                                     width="180">
                    </el-table-column>

                    <el-table-column show-overflow-tooltip
                                     prop="castModelName"
                                     label="浇筑方式"
                                     width="150">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="pumpDeviceName"
                                     label="泵送设备"
                                     width="150">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="distance"
                                     label="运距(KM)"
                                     width="100"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="carCode"
                                     label="搅拌车"
                                     width="150">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="driver"
                                     label="司机"
                                     width="150">
                    </el-table-column>
                    <!-- <el-table-column fixed="right" label="状态" width="80">
                         <template slot-scope="scope">
                             <template v-if="scope.row.process == 6">
                                 <el-tag type="danger" size="mini"
                                 >{{scope.row.processTxt}}
                                 </el-tag>
                             </template>
                             <template v-else>
                                 {{scope.row.processTxt}}
                             </template>
                         </template>
                     </el-table-column>-->
                    <el-table-column fixed="right"
                                     label="操作"
                                     width="150">
                        <template scope="scope">
                            <el-button-group>
                                <el-tooltip class="item" effect="dark" content="点击查看定位" placement="top">
                                    <el-button icon="el-icon-position" size="mini" type="primary" circle></el-button>
                                </el-tooltip>
                                <el-tooltip content="查看发货单详情" placement="top">
                                    <el-button icon="el-icon-view" size="mini" type="info" circle
                                               @click="showInvDetail(scope.row.id)"></el-button>
                                </el-tooltip>
                                <!--  发货单消耗 -->
                                <el-tooltip content="查看发货单消耗" placement="top">
                                    <el-button icon="el-icon-coin" size="mini" type="success" circle
                                               @click="showExpendDialog(scope.row)"></el-button>
                                </el-tooltip>
                            </el-button-group>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination background
                               @size-change="handleSizeChange"
                               @current-change="handleCurrentChange"
                               :page-sizes="[50, 100, 200,500]"
                               :page-size="tableSearch.limit"
                               :current-page.sync="tableSearch.pageIndex"
                               layout="total,sizes, prev, pager, next"
                               :total="tableSearch.total">
                </el-pagination>
            </template>
        </el-main>
    </el-container>
    <!-- 发货单消耗 -->
    <el-dialog title="发货单消耗" :visible.sync="invExpendDialog.show" width="70%" center :close-on-click-modal="0"
               v-loading="invExpendDialog.loading" custom-class="handle-expend-dialog">
        <el-descriptions :column="6" size="mini" border class="invoice-data-desc"
                         label-class-name="invoice-data-desc-label">
            <template slot="title">
                工程信息
            </template>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>项目名称
                </template>
                {{invoice.conName}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-s-operation"></i>施工部位
                </template>
                {{invoice.site}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-s-operation"></i>强度等级
                </template>
                {{invoice.strengthName}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-s-operation"></i>本车方量
                </template>
                {{invoice.sendStere}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-truck"></i>累计车次
                </template>
                {{invoice.totalCar}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-s-operation"></i>累计方量
                </template>
                {{invoice.totalStere}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-s-order"></i>任务单号
                </template>
                {{invoice.indentCode}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-s-order"></i>发货单号
                </template>
                {{invoice.code}}
            </el-descriptions-item>
        </el-descriptions>
        <!--<el-form :inline="true" class="demo-form-inline">
            <el-form-item label="项目名称">
                {{invoice.conName}}
            </el-form-item>
            <el-form-item label="施工部位">
                {{invoice.site}}
            </el-form-item>
            <el-form-item label="强度等级">
                {{invoice.strengthName}}
            </el-form-item>
            <el-form-item label="累计车次">
                {{invoice.totalCar}}
            </el-form-item>
            <el-form-item label="累计方量">
                {{invoice.totalStere}}
            </el-form-item>
        </el-form>-->
        <el-tabs v-model="invExpendActiveName" type="card" @tab-click="handleClick">
            <template v-for="batchExpend in batchExpends">
                <el-tab-pane :label="'第' + batchExpend.batchNum + '盘'" :name="batchExpend.batchNum">
                    <el-table :data="batchExpend.labExpendList" style="width: 100%" border>
                        <!-- <el-table-column label="盘方量" width="100">
                             {{batchExpend.batchStere}}
                         </el-table-column>-->
                        <el-table-column label="材料名称" prop="nameNorms" width="150"></el-table-column>
                        <el-table-column label="ERP仓位" prop="storageName" width="150"></el-table-column>
                        <el-table-column label="工控仓位" prop="controlStorage" width="150"></el-table-column>
                        <el-table-column label="工控含水量(%)" prop="controlWater" width="150"></el-table-column>
                        <el-table-column label="单方设定用量(KG)" width="150" prop="optimizeQuantity"></el-table-column>
                        <el-table-column label="本盘设定用量(KG)" prop="controlSetQuantity" width="150"></el-table-column>
                        <el-table-column label="本盘实际用量(KG)" prop="controlRealQuantity" width="150"></el-table-column>
                        <el-table-column label="下料时间" prop="useTime" width="180"></el-table-column>
                        <el-table-column label="误差值" prop="conErrorValue" width="100"></el-table-column>
                        <el-table-column label="误差率(%)" prop="conErrorRate" width="100"></el-table-column>
                    </el-table>
                </el-tab-pane>
            </template>
        </el-tabs>
    </el-dialog>
    <!--  发货单详情  -->
    <el-dialog title="发货单详情信息" width="70%" :visible.sync="detailDialog.show" center :close-on-click-modal="0"
               v-loading="detailDialog.loading" custom-class="invoice-detail-dialog">
        <el-descriptions class="margin-top" :column="6" size="mini" border v-loading="detailDialog.loading">
            <template slot="title">
                {{invoiceDetail.code}}
                <template v-if="invoiceDetail.process == 6">
                    <el-tag type="danger" size="mini">已{{invoiceDetail.processTxt}}</el-tag>
                </template>
            </template>
            <el-descriptions-item span="2">
                <template slot="label">
                    <i class="el-icon-user"></i>
                    任务单号
                </template>
                {{invoiceDetail.indentCode}}
            </el-descriptions-item>
            <el-descriptions-item span="2">
                <template slot="label">
                    <i class="el-icon-location-outline"></i>
                    合同名称
                </template>
                {{invoiceDetail.conName}}
            </el-descriptions-item>
            <el-descriptions-item span="2">
                <template slot="label">
                    <i class="el-icon-tickets"></i>
                    客户名称
                </template>
                {{invoiceDetail.clientName}}
            </el-descriptions-item>
            <el-descriptions-item span="2">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    施工单位
                </template>
                {{invoiceDetail.builder}}
            </el-descriptions-item>
            <el-descriptions-item span="4">
                <template slot="label">
                    <i class="el-icon-mobile-phone"></i>
                    施工部位
                </template>
                {{invoiceDetail.site}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    销售人员
                </template>
                {{invoiceDetail.sales}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-mobile-phone"></i>
                    工地联系人
                </template>
                {{invoiceDetail.linkMan}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-mobile-phone"></i>
                    工地联系方式
                </template>
                {{invoiceDetail.linkPhone}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-mobile-phone"></i>
                    前场工长
                </template>
                {{invoiceDetail.foreman}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    运距
                </template>
                {{invoiceDetail.distance}}
            </el-descriptions-item>
            <el-descriptions-item label-class-name="invoice-keynote" content-class-name="invoice-keynote">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    强度等级
                </template>
                {{invoiceDetail.strengthName}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    特性要求
                </template>
                {{invoiceDetail.tech}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    塌落度
                </template>
                {{invoiceDetail.slumps}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    浇筑方式
                </template>
                {{invoiceDetail.castModelName}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    泵送设备
                </template>
                {{invoiceDetail.pumpDeviceName}}
            </el-descriptions-item>
            <!-- <el-descriptions-item>
                 <template slot="label">
                     <i class="el-icon-office-building"></i>
                     生产方式
                 </template>
                 {{invoiceDetail.createTypeTxt}}
             </el-descriptions-item>-->
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    发货类型
                </template>
                {{invoiceDetail.invoiceTypeTxt}}
            </el-descriptions-item>
            <el-descriptions-item label-class-name="invoice-keynote" content-class-name="invoice-keynote">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    生产线
                </template>
                {{invoiceDetail.mixName}}
            </el-descriptions-item>
            <el-descriptions-item label-class-name="invoice-keynote" content-class-name="invoice-keynote">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    生产时间
                </template>
                {{invoiceDetail.proTime}}
            </el-descriptions-item>
            <!--<el-descriptions-item label-class-name="invoice-keynote" content-class-name="invoice-keynote">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    生产方量
                </template>
                {{invoiceDetail.sendStere}}
            </el-descriptions-item>-->
            <el-descriptions-item label-class-name="invoice-keynote" content-class-name="invoice-keynote">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    发货方量
                </template>
                {{invoiceDetail.sendStere}}
            </el-descriptions-item>
            <el-descriptions-item label-class-name="invoice-keynote" content-class-name="invoice-keynote">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    签收方量
                </template>
                {{invoiceDetail.signStere}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    工地退回方量
                </template>
                {{invoiceDetail.buildReStere}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    过磅退回方量
                </template>
                {{invoiceDetail.weightReStere}}
            </el-descriptions-item>
            <!--<el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    转入方量
                </template>
                {{invoiceDetail.inStere}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    转出方量
                </template>
                {{invoiceDetail.outStere}}
            </el-descriptions-item>-->
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    报废方量
                </template>
                {{invoiceDetail.scrapStere}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    是否累计
                </template>
                {{invoiceDetail.isAddTxt}}
            </el-descriptions-item>
            <el-descriptions-item></el-descriptions-item>
            <el-descriptions-item label-class-name="invoice-keynote" content-class-name="invoice-keynote">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    累计车次
                </template>
                <template v-if="invoiceDetail.process != 6">
                    {{invoiceDetail.totalCar}}
                </template>
                <template v-else>
                    <el-tag type="danger" size="mini">已{{invoiceDetail.processTxt}}</el-tag>
                </template>
            </el-descriptions-item>
            <el-descriptions-item label-class-name="invoice-keynote" content-class-name="invoice-keynote">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    累计方量
                </template>
                <template v-if="invoiceDetail.process != 6">
                    {{invoiceDetail.totalStere}}
                </template>
                <template v-else>
                    <el-tag type="danger" size="mini">已{{invoiceDetail.processTxt}}</el-tag>
                </template>
            </el-descriptions-item>
            <!--<el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    是否过磅称重
                </template>
                {{invoiceDetail.isWeightTxt}}
            </el-descriptions-item>-->
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    调度员
                </template>
                {{invoiceDetail.dispatcherName}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    拌台操作员
                </template>
                {{invoiceDetail.mixUserName}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    车号
                </template>
                {{invoiceDetail.carCode}},{{invoiceDetail.carNo}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    司机
                </template>
                {{invoiceDetail.driver}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    票据类型
                </template>
                {{invoiceDetail.receiptTypeTxt}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    特殊结算类型
                </template>
                {{invoiceDetail.specialClearTypeTxt}}
            </el-descriptions-item>
            <el-descriptions-item>
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    道路类型
                </template>
                {{invoiceDetail.roadTypeTxt}}
            </el-descriptions-item>
            <el-descriptions-item :span="6">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    备注
                </template>
                {{invoiceDetail.remark}}
            </el-descriptions-item>
            <el-descriptions-item :span="6">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    运输备注
                </template>
                {{invoiceDetail.tranRemark}}
            </el-descriptions-item>
            <el-descriptions-item :span="6">
                <template slot="label">
                    <i class="el-icon-office-building"></i>
                    泵送备注
                </template>
                {{invoiceDetail.pumpRemark}}
            </el-descriptions-item>
        </el-descriptions>
    </el-dialog>
</div>
</body>
<script type="text/javascript" th:src="@{/static/console/assets/js/jquery-3.2.1.min.js}"></script>
<script type="text/javascript" th:src="@{/static/console/js/pages/base.js}" charset="utf-8"></script>
<script type="text/javascript" th:src="@{/static/js/vue.min.js}"></script>
<script type="text/javascript" th:src="@{/static/js/element/index.js}"></script>
<script type="text/javascript" th:src="@{/static/console/datepicker/jquery-datePicker.js}" charset="utf-8"></script>
<script type="text/javascript" th:src="@{/static/console/js/pages/inspect/invoice-lab.js?version=202505201442}"
        charset="utf-8"></script>

</html>